home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hráč 2004 August
/
Hrac_72_2004-08_dvd.iso
/
dema
/
Rapid Gun
/
rg_setup.exe
/
common
/
fog.fxh
< prev
next >
Wrap
Text File
|
2004-04-21
|
738b
|
21 lines
// LF2 Engine
// (C) 2002-3 7FX
//---------------------------------------------------------------------------
// Header file with fog functions
//---------------------------------------------------------------------------
// Fog - input: view vertex position - output: fog factor
// Linear fog formula
float LinearFog(const float3 viewPos)
{
// f = (end - d)/(end - start)
return (500.f - viewPos.z)/(500.f - 0.f);
}
//---------------------------------------------------------------------------
// Exponential fog formula
float ExpFog(const float3 viewPos)
{
// f = 1.f/(e^(d * density))
return 1.0f/(pow(SC_E, viewPos.z * 0.005f));
}
//---------------------------------------------------------------------------